﻿// MIT License
// 开源地址：https://gitee.com/co1024/AbcMvc
// Copyright (c) 2021-2022 1024
// Abc.Mvc=Furion+EF+SqlSugar+Pear layui admin.

using Abc.Application.HtAdminServices;

namespace Abc.Application;

/// <summary>
/// 应用层初始化调用
/// </summary>
public static class ApplicationInit
{
    public static void Init()
    {
        var _logger = AppEx.GetSeriLogger("Application/Init");
        try
        {
            Scoped.Create((factory, scope) =>
            {
                var services = scope.ServiceProvider;

                var developerService = App.GetService<IDeveloperService>(services);
                developerService.UpdateMenuPermission();
            });
        }
        catch (Exception ex)
        {
            _logger.Error(exception: ex);
        }
    }
}